import request from '@/config/axios'

export interface CmOutnumberVO {
  id: number
  displayNumber: string
  outNumber: string
  status: number
  cmSipGateway: number
}

// 查询外呼号码列表
export const getCmOutnumberPage = async (params) => {
  return await request.get({ url: `/call/cm-outnumber/page`, params })
}

// 查询外呼号码详情
export const getCmOutnumber = async (id: number) => {
  return await request.get({ url: `/call/cm-outnumber/get?id=` + id })
}

// 新增外呼号码
export const createCmOutnumber = async (data: CmOutnumberVO) => {
  return await request.post({ url: `/call/cm-outnumber/create`, data })
}

// 修改外呼号码
export const updateCmOutnumber = async (data: CmOutnumberVO) => {
  return await request.put({ url: `/call/cm-outnumber/update`, data })
}

// 删除外呼号码
export const deleteCmOutnumber = async (id: number) => {
  return await request.delete({ url: `/call/cm-outnumber/delete?id=` + id })
}

// 导出外呼号码 Excel
export const exportCmOutnumber = async (params) => {
  return await request.download({ url: `/call/cm-outnumber/export-excel`, params })
}

// 获取外呼号码list
export const getCmOutnumberSimpleList = async () => {
  return await request.get({ url: `/call/cm-outnumber/simple-list` })
}

// 获取租户所属外呼号码list
export const getCmOutnumberTenantList = async () => {
  return await request.get({ url: `/call/cm-outnumber/tenant-list` })
}

// 获取网关list
export const getCmSipSimpleList = async () => {
  return await request.get({ url: `/call/cm-sip-gateway/simple-list` })
}
